package org.liuyunfeng.web;

import org.liuyunfeng.domain.YfbInformationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * @author: TanJingyu
 * @create: 2022-07-11 15:51
 **/
@RestController
@RequestMapping("/information")
public class InformationTestController {
    @Autowired
    private YfbInformationMapper mapper;

    @GetMapping
    public String insert() {
        int tenThousand = 5;

        for (int j = 0; j < 100 * tenThousand; j++) {
            ArrayList<Map<String,Object>> objects = new ArrayList<>();
            for (int i = 0; i < 2000; i++) {
                HashMap<String,Object> map = new HashMap<>();
                map.put("memberId", i);
                map.put("openId", UUID.randomUUID().toString().replace("-", ""));
                map.put("name", "谈经与");
                map.put("phone", "15543371631");
                map.put("company", "经销商");
                map.put("email", "programtan@163.com");
                objects.add(map);
            }
            mapper.insert(objects);
        }

        return "success";
    }
}

    